import 'package:fish_redux/fish_redux.dart';
import 'package:kunlun_gas/config/network_config.dart';
import '../UserInfo/user_info_entity.dart';

abstract class GlobalBaseState<T extends Cloneable<T>> implements Cloneable<T> {
  UserInfoEntity get userInfo;

  set userInfo(UserInfoEntity info);
}

class GlobalState implements GlobalBaseState<GlobalState> {
  GlobalState() {
    this.userInfo = UserInfoEntity();
  }

  String imageUrl = NetworkConfig.imgUrl;
  String uploadUrl = NetworkConfig.upLoadUrl;

  @override
  UserInfoEntity userInfo;

  @override
  GlobalState clone() {
    return GlobalState()
      ..userInfo = userInfo
      ..uploadUrl = uploadUrl
      ..imageUrl = imageUrl;
  }
}
